From: Rui Matos Date: Sun, 1 Jul 2012 16:38:28 +0000 (+0200) Subject: iconGrid: Handle preferred height requests for infinite widths X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5328 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=29cb10fed8c018cce6d761af9bb19b933715337a;p=gnome-shell.git iconGrid: Handle preferred height requests for infinite widths Request enough height to fit all children in a single line instead of requesting 0. https://bugzilla.gnome.org/show_bug.cgi?id=679168 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 81f5cef84..04b8caf69 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -198,7 +198,11 @@ const IconGrid = new Lang.Class({ _getPreferredHeight: function (grid, forWidth, alloc) { let children = this._getVisibleChildren(); - let [nColumns, usedWidth] = this._computeLayout(forWidth); + let nColumns; + if (forWidth < 0) + nColumns = children.length; + else + nColumns = this._computeLayout(forWidth)[0]; let nRows; if (nColumns > 0) nRows = Math.ceil(children.length / nColumns);